import java.util.*;

public class addrCollection
{
	Scanner scan = new Scanner (System.in);
	public Addr[] collection;
	public int count;


	public addrCollection () 
	{ 
		collection = new Addr[100];
		count = 0;
	}

	public void addAddr (String lastName, String firstName, String position, String department, String companyName, String addr, String telephoneNum, String faxNum, String mobileNum, String email, String homepage) 
	{
		if (count == collection.length)
			increaseSize();

		collection[count] = new Addr (lastName, firstName, position, department, companyName, addr, telephoneNum, faxNum, mobileNum, email, homepage); 
		count++;
	}
	
	public void modiadd (int num, String lastName, String firstName, String position, String department, String companyName, String addr, String telephoneNum, String faxNum, String mobileNum, String email, String homepage) 
	{
		collection[num] = new Addr (lastName, firstName, position, department, companyName, addr, telephoneNum, faxNum, mobileNum, email, homepage); 
	}

	public void increaseSize ()
	{
		Addr[] temp = new Addr[collection.length * 2];

		for (int addr = 0; addr < collection.length; addr++) 
			temp[addr] = collection[addr];
		collection = temp;
	}

	public String toString ()
	{
		String report = "";

		for(int num=0; num<count; num++)
		{
			if(collection[num] != null)
				report += collection[num].toString() + "\n";
		}

		return report;
	}
}